/*********************************************************************************
Organization 					: 				Georgia Institute of Technology
  
Institute 						:				Cognitive Computing Group(CCL)
 
Authors							: 				Santiago Ontanon
 												
Class							:				GoldCondition
 
Function						: 				Provides a class for holding 
												the gold condition class
****************************************************************************/
package planninglanguage.softconditions;

import mre.MRE;
import base.WargusGameState;


public class AbsoluteGoldSoftCondition extends SoftCondition {
	int m_minGold;
	public AbsoluteGoldSoftCondition(int a_minGold)
	{
		m_minGold = a_minGold;
	}
	
	public String toString(int tabs) {
	  String n = super.toString(tabs);
	  n = n + "Min Gold is :" + m_minGold;
	  return n;
	}
	
	public float test(WargusGameState a_gameState)
	{
		if (a_gameState.getPlayer().getGold()-MRE.allocated_gold >= m_minGold) return 1.0f;
																		  else return (a_gameState.getPlayer().getGold()-MRE.allocated_gold)/((float)m_minGold);		
	}
	
}
